{% extends "layout.html" %}
{% block title %}Home{% endblock %}
{% block scripts %}
{{ super() }}
<script>
	var NEWS_URL = "{{url_for('home_app.news')}}";
	var MAX_NEWS = {{max_news}};
	var DELETE_FILE_URL = "{{url_for('editor_app.delete_file', owner=g.user.username, filename='insertfilenamehere')}}";
	var NEW_FILE_URL = "{{url_for('editor_app.new_file', owner=g.user.username)}}";
	var CRITTER_JSON_URL = "{{url_for('editor_app.get_critters_json')}}";
	var CRITTER_JSON_USER_URL = "{{url_for('editor_app.get_critters_json_user')}}";
	var CRITTER_USER_IDS_URL = "{{url_for('editor_app.get_user_critter_ids')}}";
	var CRITTER_RECENT_BATTLES_URL = "{{url_for('editor_app.get_critter_recent_battles')}}";
	var CUSTOM_BATTLE_URL = "{{url_for('battles_app.custom_battle_page')}}";
	var RANKED_BATTLE_URL = "{{url_for('battles_app.request_ranked_battle')}}";
	var USERNAME = "{{g.user.username|safe}}";
</script>
<script type="text/javascript" src="{{ url_for('static', filename='js/home.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/news.js') }}"></script>
{% endblock scripts %}
{% block body %}
<h1> Home </h1>
<section id="dashboard">
	<!-- <div class="battles">
		<button><a href="{{url_for('battles_app.custom_battle_page')}}">Custom Battle</a></button>
	</div> -->
	<div class="critters">
		<h2>My Critters</h2>
		<ul id="critterlist" class="list">
			<li>
				<div class="top">
					<span class="name item">Name</span>
					<span class="score item">Score</span>
					<span class="wins item">Wins</span>
					<span class="losses item">Losses</span>
				</div>
			</li>
			<li>
				<button class="newcritterbutton">New Critter</button>
			</li>
		</ul>
	</div>
</section>

{% if (g.user.admin) %}
<section class="admin">
	<h2>Admin</h2>
	<ul class="tools">
		<li><a href="{{url_for('users_app.list_users')}}">All Users</a></li>
	</ul>
	<ul class="tools">
		<li><a href="{{url_for('users_app.list_users')}}">All Users</a></li>
	</ul>
</section>
{% endif %}
{% endblock %}